package com.action.mail;


import com.db.mail.*;
public class Delete_MailAction {

	private int s_email_num;
	private int r_email_num;
	private String rubbish;
	
	
	public void setRubbish(String rubbish) {
		this.rubbish = rubbish;
	}

	public void setS_email_num(int s_email_num) {
		this.s_email_num = s_email_num;
	}

	public void setR_email_num(int r_email_num) {
		this.r_email_num = r_email_num;
	}

	public String delete() throws Exception {
		
		
		MailDAO.deleteRGetData(s_email_num);
		MailDAO.deleteSGetData(s_email_num);
		 System.out.println(r_email_num+"r"+s_email_num+"S");
		return "success";
	}
	
	public String deleteAll() throws Exception {
		
		String num[]=rubbish.split("-");
		for(int i=0;i<num.length;i++){
			
			MailDAO.deleteSGetData(Integer.parseInt(num[i]));
			MailDAO.deleteRGetData(Integer.parseInt(num[i]));
		}
		
		return "success";
	}
}
